#ifndef __KUTILS_H
#define __KUTILS_H

#define ASSERT(exp)  if(exp) ; else  write_string("Assertation failed!");

#define FLUIDIUM_DEBUG

#define enable_interrupts() __asm__ __volatile__ ("sti");

#define disable_interrupts() __asm__ __volatile__("cli");

#define wait_interrupt() __asm__ __volatile__ ("hlt");

#define halt()	__asm__ __volatile__("cli"); __asm__ __volatile__ ("hlt");

typedef	unsigned long long 	u64int;
typedef				long long 	s64int;
typedef	unsigned	int 			u32int;
typedef 				int 			s32int;
typedef	unsigned	short			u16int;
typedef				short			s16int;
typedef	unsigned	char			u8int;
typedef				char			s8int;

typedef s32int size_t;

//memory related
void *memcpy(void *dest, const void *src, size_t count);
void *memset(void *dest,s32int val, size_t count);
u16int *memsetw(u16int *dest, u16int val, size_t count);
void exit(int ExitCode);

//in out related
void outportb(u16int _port, u8int _data);
u8int inportb(u16int _port);
void outportw(u16int _port, u32int _data);
u32int inportw(u16int _port);
u32int inportl(u16int _port);
void outportl(u16int _port, u32int _data);

//other
void debug(void);
void wait(u32int millisconds);

#endif
